﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AJAX_learning.Chapter11
{
	public partial class p1 : Page
	{
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);

			//Response.Cache.SetCacheability(HttpCacheability.Public);
			//Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
			//Response.Cache.SetValidUntilExpires(true);

			//TimeLabel.Text = "DateTime.Now: <br />";
			//TimeLabel.Text += DateTime.Now.ToString();


			Response.Write("This date is cached with the page: ");
			Response.Write(DateTime.Now.ToString() + "<br />");
			Response.Write("This date is not: ");
			//Response.WriteSubstitution(GetDate);
		}

		private static string GetDate(HttpContext context)
		{
			return "<b>" + DateTime.Now.ToString() + "</b>";
		}
	}
}